% https://en.wikipedia.org/wiki/Push%E2%80%93relabel_maximum_flow_algorithm#Example
% matlab code to solve maxflow using linear programming
f = [-1 -1 0 0 0 0 0 0]
A = eye(8)
b = [15,4,12,7,10,10,5,3]
Aeq = [1 0 -1 0 0 0 1 0;0 0 1 -1 0 0 0 -1;0 1 0 0 -1 0 0 1;0 0 0 0 1 -1 -1 0]
beq = [0 0 0 0]
lb = [0 0 0 0 0 0 0 0]
[x,fval] = linprog(f,A,b,Aeq,beq,lb)